package com.djq.project.mq.consumer.topics;

import com.djq.project.mq.consumer.routing.RoutingConfig;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class RecvTopics {

    @RabbitListener(queues = TopicsConfig.QUEUE_TOPIC_A)
    @RabbitHandler
    public void receiveA(String in) {
        System.out.println(" ["+TopicsConfig.QUEUE_TOPIC_A+"] Received '" + in + "'");
    }

    @RabbitListener(queues = TopicsConfig.QUEUE_TOPIC_B)
    @RabbitHandler
    public void routingB(String in) {
        System.out.println(" ["+TopicsConfig.QUEUE_TOPIC_B+"] Received '" + in + "'");
    }
}
